package com.xxx.networkdisksystem.controller;
import com.xxx.networkdisksystem.config.Request;
import com.xxx.networkdisksystem.pojo.Depttree;
import com.xxx.networkdisksystem.service.DepttreeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author George
 * @since 2023-12-03
 */
@Api(tags = "部门管理")
@CrossOrigin
@RestController
@RequestMapping("/depttree")
public class DepttreeController {
    @Resource
    private DepttreeService depttreeService;

    @PostMapping(value = "/saveDeptTree")
    public boolean saveDeptTree(){
        Depttree depttree = new Depttree();
        depttree.setDeptName("");
        depttree.setSuperiorDept("8c82499a9721074784acdfc10adeae20");
        return depttreeService.save(depttree);
    }
    @GetMapping(value = "/listDeptTree")
    public Request listDeptTree(){
        Object data = depttreeService.list();
        return Request.suc(null,data);

    }
}

